﻿@{
    ViewBag.Title = "览月齐鲁";
}
@model mscook.mvc.Models.LoginModel
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title>览月齐鲁</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Le styles -->
    <link href="~/BootStrap/css/bootstrap.css" rel="stylesheet" />
    <link href="~/css/mscook.css" rel="stylesheet" type="text/css" />
    <link href="~/Carousel/allinone_thumbnailsBanner.css" rel="stylesheet" />
    <link href="~/Carousel/featureCarousel.css" rel="stylesheet" />
    <!--<script src="http://a.tbcdn.cn/s/kissy/1.3.0/kissy.js"></script>
    <script src="apps/core.js"></script>-->

    <link href="~/Carousel/accordion.css" rel="stylesheet" />
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
        <script src="BootStrap/js/html5.js"></script>
        <script src="BootStrap/js/respond.src.js"></script>
        
    <![endif]-->
    <!--[if lte IE 6]>
        <link rel="stylesheet" type="text/css" href="BootStrap/css/bootstrap-ie6.css">
    <![endif]-->
    <!--[if lte IE 7]>
        <link rel="stylesheet" type="text/css" href="BootStrap/css/ie.css">
    <![endif]-->
    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://www.bootcss.com/assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://www.bootcss.com/assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://www.bootcss.com/assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="http://www.bootcss.com/assets/ico/apple-touch-icon-57-precomposed.png">
</head>
<body style="background: #F3F5F8;">
    <div class="modal hide fade" id="ForgetModal">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">×</button>
            <h3>重置密码</h3>
        </div>
        <div class="modal-body">
            <div id="toInput">
                <p>用户名:</p>
                <p>
                    <input name="userName" class="userName" type="text" />
                </p>
                <p>注册邮箱:</p>
                <p>
                    <input name="email" class="email" type="text" />
                </p>
            </div>
            <p class="message"></p>
        </div>

        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">关闭</a>
            <a href="javaScript:void(0)" id="makesureForget" data-url="@Url.Action("ForGetPassword")" class="btn btn-inverse">确定</a>

        </div>

    </div>
    <!-- NAVBAR
================================================== -->
    <div class="login_main">
        <div class="container">
            <div id="login" class="accounts-form row">
                <div class="span10 offset2 row">
                    <h1 class="span3">
                        <img src="~/Images/login_logo.png" /></h1>
                    <h3 class="span3">LanYueQiLu</h3>
                </div>

                

                <div class="span6 offset4">
                    @using (Html.BeginForm("Login", "Account", FormMethod.Post, new { id = "auth-form" }))
                    {  @Html.AntiForgeryToken()
                        @Html.ValidationSummary(true)
                        <!--<form action="#" id="auth-form"> -->
                        <div class="all-errors">
                        </div>
                        <div class="input">
                            @Html.TextBoxFor(m => m.UserName, new { id = "id_username", maxlength = "75", placeholder = "用户名或邮箱" })
                            @Html.ValidationMessageFor(m => m.UserName)
                            <!--<input id="id_username" type="text" name="username" maxlength="75" placeholder="用户名或邮箱"> -->
                        </div>
                        <div class="input">
                            @Html.PasswordFor(m => m.Password, new { id = "id_password", placeholder = "密码" })
                            @Html.ValidationMessageFor(m => m.Password)
                            <!-- <input type="password" name="password" id="id_password" placeholder="密码"> -->
                        </div>
                        <div class="actions">
                            <input type="submit" value="登&nbsp&nbsp录" class="btn btn-primary">
                            <a id="forgetPwd" href="#">密码不记得?</a>
                        </div>
                        <!--</form>-->
                    }
                </div>
            </div>
        </div>
    </div>
    <script src="@Url.Content("~/bootstrap/js/jquery-1.9.1.js")"></script>
    <script src="@Url.Content("~/BootStrap/js/bootstrap.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            if (!placeholderSupport()) {   // 判断浏览器是否支持 placeholder
                $('[placeholder]').focus(function () {
                    var input = $(this);
                    if (input.val() == input.attr('placeholder')) {
                        input.val('');
                        input.removeClass('placeholder');
                    }
                }).blur(function () {
                    var input = $(this);
                    if (input.val() == '' || input.val() == input.attr('placeholder')) {
                        input.addClass('placeholder');
                        input.val(input.attr('placeholder'));
                    }
                }).blur();
            };

            $("#forgetPwd").click(function () {
                $("#ForgetModal").modal("show");
                return false;
            });

            $("#makesureForget").click(function () {
                $("#ForgetModal p.message").html("");
                var url = $(this).data("url");
                var username = $("#ForgetModal input.userName").val();
                var email = $("#ForgetModal input.email").val();
                if (username != "" && email != "") {
                    $.ajax({
                        url: url,
                        global: false,
                        type: "POST",
                        data: { username: username, email: email },
                        dataType: "json",
                        success: function (data) {
                            if (data.isSucceed) {
                                $("#toInput").hide();
                            }
                            $("#ForgetModal p.message").html(data.message);

                        }
                    });
                }
            });

            function placeholderSupport() {
                return 'placeholder' in document.createElement('input');
            }
        })
    </script>
    <!--[if lte IE 6]>
<script type="text/javascript" src="js/bootstrap-ie.js"></script>
<![endif]-->
</body>
</html>
